#ifndef TE_CLASSGRADE_H
#define TE_CLASSGRADE_H

#include <QWidget>
#include <QComboBox>
#include <QSqlQueryModel>

namespace Ui {
class TE_ClassGrade;
}

class TE_ClassGrade : public QWidget
{
    Q_OBJECT

public:
    explicit TE_ClassGrade(QWidget *parent = nullptr);
    ~TE_ClassGrade();



    void setDataToTable(const QList<DB_View_StudentGrades> &data);

    void setDataToTable(const QList<DB_View_StudentInfo> &data);

private slots:


    void on_comboBox_activated(int index);
    int getClassId();

    void on_comboBox_2_activated(int index);
    int getCourseId();


    void updateTable();

    void on_pushButton_clicked();
    void on_pushButton_2_clicked();
    void on_pushButton_3_clicked();
    void on_pushButton_4_clicked();

private:
    void setClassComboBox(QString where);

    void setCourseComboBox(QString where);

    QList<int> generateReverseRankings(const QList<double>& doubleList);

private:
    Ui::TE_ClassGrade *ui;


protected:
    virtual void showEvent(QShowEvent *event) override;
};

#endif // TE_CLASSGRADE_H
